package Server;

import java.util.ArrayList;

public class DataAccess {

	private Database database = null;

	public DataAccess() {}

	public boolean open() {
		database = CommaSeperatedFile.getInstance();
		if (database != null)
			return true;
		else
			database = DatabaseQueue.getInstance();
		return false;
	}

	public void release() {
		if (database != null)
			CommaSeperatedFile.release( );
	}	

	public boolean insert(ArrayList<Integer> data) {
		if (database.insert(data))
			return true;
		return false;
	}

	public ArrayList<Integer> get() {
		return database.get();
	}

}
